package com.sneakxy.mybase4j.platform.provider;

import com.alibaba.dubbo.config.annotation.Service;

import com.sneakxy.mybase4j.base.provider.BaseProvider;

import com.sneakxy.mybase4j.platform.beans.RolePerm;
import com.sneakxy.mybase4j.platform.beans.RolePermId;

import com.sneakxy.mybase4j.platform.provider.IRolePermProvider;

import com.sneakxy.mybase4j.platform.repository.RolePermRepository;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

/**
 * 
 * @author 潜行的青衣
 * @see
 */
@Service(version = "1.0.0", interfaceClass = IRolePermProvider.class)
@org.springframework.stereotype.Service
public class RolePermProvider extends BaseProvider<RolePerm, RolePermId, RolePermRepository> implements IRolePermProvider {

	@Autowired
	public RolePermProvider(RolePermRepository repository) {
		super(repository);
	}

	/* (non-Javadoc)
	 * @see com.sneakxy.mybase4j.platform.provider.IRolePermProvider#findPermissions(java.util.List)
	 */
	@Override
	public List<String> findPermissions(List<String> roles) {
		return this.getRepository().findPermissions(roles);
	}

	/* (non-Javadoc)
	 * @see com.sneakxy.mybase4j.platform.provider.IRolePermProvider#deleteByPermId(java.lang.String)
	 */
	@Override
	public int deleteByPermId(String permId) {
		return this.getRepository().deleteByPermId(permId);
	}

	/* (non-Javadoc)
	 * @see com.sneakxy.mybase4j.platform.provider.IRolePermProvider#findPermissions(java.lang.String)
	 */
	@Override
	public List<String> findPermissions(String roleId) {
		return this.getRepository().findByRoleId(roleId);
	}

	/* (non-Javadoc)
	 * @see com.sneakxy.mybase4j.platform.provider.IRolePermProvider#deleteByRoleId(java.lang.String)
	 */
	@Override
	public int deleteByRoleId(String roleId) {
		return this.getRepository().deleteByRoleId(roleId);
	}

}
